package com.chw.common.exception;

import com.chw.common.ChwData;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class Exception {
    @ExceptionHandler(NameException.class)
    public ChwData NameException(java.lang.Exception e){
        e.printStackTrace();
        return ChwData.error(400,e.getMessage());
    }
}
